class Soldier:
    def __init__(self, name):
        self.name = name
        self.gun = None

    def fire(self):
        # 判断士兵是否有枪
        if self.gun is None:
            print("[%s]没有枪" % self.name)
            return

        print("冲啊[%s]" % self.name)
        self.gun.add_bullet(50)

        self.gun.shoot()


